<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class user_model extends MY_Model {

	protected $table		= "user";
	protected $key			= "id";
	protected $soft_deletes	= true;
	protected $date_format	= "datetime";
	protected $set_created	= false;
	protected $set_modified = false;
	protected $orderby 		= "first_name";

	//---------------------------------------------------------------
	
	function login($user_email)
	{
		$this->db->where('deleted',0);
		$this->db->where('username',$user_email);
		$this->db->or_where('email',$user_email);
		 $query = $this->db->get($this->table);
		/*
		echo '<pre>';
		
		print_r($this->db->last_query());
		echo '<hr><br>';
		
		print_r($query->num_rows);
		echo '<hr><br>';
		
		print_r($query->result());
		echo '<hr><br>';
		
		print_r($query->num_rows);
		* */
		return $query;
	}
}
